package StrategyMode.version1;

import java.util.Scanner;

/**
 * Created by ycq on 2018/10/17.
 */
public class CollectingSilver {




    public static void main(String[] args) {
        Double total=0.0;
       btnOk_Click(total);
    }

    public static void btnOk_Click(Double  total){

        while(true){
            Scanner in =new Scanner(System.in);
            System.out.println("请输入单价");
            String txtPrice=in.next();
            System.out.println("请输入数量");
            String  txtNum=in.next();
            Double totalPrices=Double.parseDouble(txtPrice)*Double.parseDouble(txtNum);
            total=total+totalPrices;
            System.out.println("单价:"+txtPrice+" 数量:"+txtNum+" 合计:"+totalPrices);
            System.out.println("总计："+total);
        }

    }
}
